from typing import Optional
from pydantic import BaseModel

class CommandBase(BaseModel):
    command: str
    description: Optional[str] = None
    status: bool = False  # 是否已部署或启用

class CommandCreate(CommandBase):
    pass

class CommandUpdate(CommandBase):
    pass

class CommandOut(CommandBase):
    id: int

    class Config:
        orm_mode = True

class CommandExecute(BaseModel):
    command_id: int
    # 如果有参数可扩展
    params: Optional[dict] = None
